*** Settings ***
Documentation    TC01-Create a new AIR Project
Resource    ../../Keywords/Common_Head.robot
Resource    ../../Keywords/Common/Common_kw.robot
Metadata    Author     Nella
Force Tags    P1
Metadata    ID    13559


*** Test Cases ***
TC01-Create a new AIR Project
    Step 1 User Goes To Basic Data Management Tender List
    Step 2 User Goes To Pricing Collaboration Pricing Project
    Step 3 User Clicks Create Project Button
    Step 4 User Chooses The 202408151435001 Regression Test By
    Step 5 User Clicks Dropdown List From Mode Field
    Step 6 User Chooses AIR From The Dropdown List
    Step 7 User Selects The current Date 10 11 30 00 For Deadline
    Step 8 User Selects The current Date For Rate Validity From
    Step 9 User Clicks Deputy Button
    Step 10 User Inputs MARYMA01 In The SIMS ID Field Clicks Search
    Step 11 User Clicks Select Button
    Step 12 User Clicks Upload Button Add File Button In The Upload
    Step 13 User Checks The Information At The Bottom Of This
    Step 14 User Clicks Save Button
    Step 15 User Selects TenderID Contains 202408151435001
    Step 16 Select This Project Click On Delete Project Button
    Step 17 User Goes To Basic Data Management Tender List Delete tender



*** Keywords ***
Step ${step} User Goes To Basic Data Management Tender List
    #************************Step 1******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Click Create button
    #      Input with following attributes
    #      Tender ID some numbers such as 202408151435001 you can
    #     input with current datetime and some random number to
    #     avoid duplicate validation
    #      Tender Title some value such as Regression Test by
    #     Wendy001
    #      Customer 815 Miele
    #      Mode select all
    #      Level Global
    #      Click on Save button
    #  Expected:
    #      Created successfully with the message Tender has been
    #     added
    #************************************************************
    ${G_TENDERID}    Generate Tender ID
    ${TenderTitle}   Set Variable    Regress
    Set Test Variable     ${G_TENDERID}
    ${CurDate}    Get Current Date    result_format=%d/%m/%Y
    ${FutureDate}    Get Current Date    UTC    +10days    result_format=%d/%m/%Y
    ${PROJECT}    Copy Dictionary    ${PROJECT_PARAM}
    Set To Dictionary    ${PROJECT}
    ...    TENDER_ID=${G_TENDERID}    TENDER_TITLE=${TenderTitle}    CUSTOEMR_NAME=Miele    CUSTOMER_LEVEL=Global
    ...   MODE=AIR    DEADLINE_TM_DATE=${FutureDate}    DEPUTY=NATZHANG    TEMPLATE=${CURDIR}${/}TestData${/}AirTemplate-Location-All.xlsx
    ...    DEADLINE_TM_TIME=11    DEADLINE_TM_MINITE=30
    Set Test Variable    ${PROJECT}
    Login Space
    Create Tender    ${G_TENDERID}    Regress    815    true    true    true    

Step ${step} User Goes To Pricing Collaboration Pricing Project
    #************************Step 2******************************
    #  Do:
    #      User goes to Pricing Collaboration Pricing Project
    #  Expected:
    #      The project list should be searched out accordingly
    #************************************************************
    log    check in kw

Step ${step} User Clicks Create Project Button
    #************************Step 3******************************
    #  Do:
    #      User clicks Create Project button
    #      User inputs Tender ID such as 202408151435001 in the
    #     Tender ID field
    #  Expected:
    #      A New Project dialog should be opened successfully
    #      A dropdown list 202408151435001 Regression Test by
    #     Wendy001 comes up
    #************************************************************
    Create Project    ${PROJECT}

Step ${step} User Chooses The 202408151435001 Regression Test By
    #************************Step 4******************************
    #  Do:
    #      User chooses the 202408151435001 Regression Test by
    #     Wendy001 from the dropdown list
    #  Expected:
    #      Customer field should be fulfilled with Miele
    #      Vertical Market should be Consumer
    #      Level should be fulfilled with Global
    #************************************************************
    log    done in kw

Step ${step} User Clicks Dropdown List From Mode Field
    #************************Step 5******************************
    #  Do:
    #      User clicks dropdown list from Mode field
    #  Expected:
    #      There should be modes AIR from the dropdown list
    #************************************************************
    log    done in kw

Step ${step} User Chooses AIR From The Dropdown List
    #************************Step 6******************************
    #  Do:
    #      User chooses AIR from the dropdown list
    #  Expected:
    #      The project Name field should be changed to be
    #     202408151435001 AIR Regression Test by Wendy001
    #************************************************************
    log    done in kw

Step ${step} User Selects The current Date 10 11 30 00 For Deadline
    #************************Step 7******************************
    #  Do:
    #      User selects the current date 10 11 30 00 for Deadline
    #     to TM field
    #  Expected:
    #      The current date 10 11 30 00 should be input
    #     successfully
    #************************************************************
    log    updated in kw

Step ${step} User Selects The current Date For Rate Validity From
    #************************Step 8******************************
    #  Do:
    #      User selects the current date for Rate Validity From
    #      User selects the current date 30 for Rate Validity To
    #  Expected:
    #      They both should be input successfully
    #************************************************************
    log    done in kw

Step ${step} User Clicks Deputy Button
    #************************Step 9******************************
    #  Do:
    #      User clicks Deputy button
    #  Expected:
    #      The User locator dialog should be opened
    #************************************************************
    log    done in kw

Step ${step} User Inputs MARYMA01 In The SIMS ID Field Clicks Search
    #************************Step 10******************************
    #  Do:
    #      User inputs MARYMA01 in the SIMS ID field clicks search
    #     button
    #  Expected:
    #      The MARYMA01 should be searched out
    #************************************************************
    log    done in kw

Step ${step} User Clicks Select Button
    #************************Step 11******************************
    #  Do:
    #      User clicks select button
    #  Expected:
    #      The User locator dialog should be closed and MARYMA01
    #     should be added into the Deputy
    #************************************************************
    log    done in kw
   
Step ${step} User Clicks Upload Button Add File Button In The Upload
    #************************Step 12******************************
    #  Do:
    #      User clicks upload button add file button in the Upload
    #     Template dialog choose a file
    #  Expected:
    #      The file should be uploaded successfully in the
    #     document section
    #************************************************************
    log    done in kw

Step ${step} User Checks The Information At The Bottom Of This
    #************************Step 13******************************
    #  Do:
    #      User checks the information at the bottom of this
    #     dialog
    #  Expected:
    #      The Project Owner should be current user name SIMS ID
    #      Create Date should be current system date
    #      Status should be In Progress
    #************************************************************
    log    done in kw

Step ${step} User Clicks Save Button
    #************************Step 14******************************
    #  Do:
    #      User clicks save button
    #  Expected:
    #      The project should be saved at the top of the project
    #     list
    #************************************************************
    log    done in kw

Step ${step} User Selects TenderID Contains 202408151435001
    #************************Step 15******************************
    #  Do:
    #      User selects TenderID Contains 202408151435001
    #  Expected:
    #      The project could be found
    #************************************************************
    Search Project    ${G_TENDERID}

Step ${step} Select This Project Click On Delete Project Button
    #************************Step 16******************************
    #  Do:
    #      Select this project click on Delete Project button
    #      Click Yes of the pop up confirm window
    #  Expected:
    #      System displays Project has been deleted
    #************************************************************
    log    teardown

Step ${step} User Goes To Basic Data Management Tender List Delete tender
    #************************Step 17******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Search out the tender created in step1
    #      Click on Delete button
    #      Click on Yes button in the popup dialog
    #  Expected:
    #      System displays Tender has been deleted
    #************************************************************
    log    teardown
  
 